package com.sure.oa;

import com.sure.oa.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController //说明这是一个控制器组件，并受spring管理
public class TestController {

    //业务类（模型）
    @Autowired //表示由spring自动按类型匹配的规则装配属性
    private TestService testService;

    @RequestMapping("/userList")
    public List<User> userList(){

        return testService.getUserList();

    }



    @RequestMapping("/kkk")
    public String hello(){
        return "您好！";
    }
}
